select * into customer
from server74.bicdata.dbo.customer
where segment='smes'
 
drop table term_deposit_1year
 
select * into term_deposit_1year 
from server74.bicdata.dbo.dptb_master
where cif in (select recid from customer)
and product_name='2. Term Deposit'
and openning_date between '20151121' and '20161122'
 
select * into term_deposit
from server74.bicdata.dbo.dptb_master
where cif in (select recid from customer)
and product_name='2. Term Deposit'
 
 
select * into term_deposit_20161122
from server74.bicdata.dbo.balance_live
where business_date='20161122'
and product_name='2. Term Deposit'
and cif in (select recid from customer)
 
select * from term_deposit_20161122
 
